// From  "Wingdi.h"


// OpenGL wgl prototypes

WINGDIAPI BOOL  WINAPI wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask);
WINGDIAPI HGLRC WINAPI wglCreateContext(HDC dc);
WINGDIAPI HGLRC WINAPI wglCreateLayerContext(HDC dc, int layer);
WINGDIAPI BOOL  WINAPI wglDeleteContext(HGLRC rc);
WINGDIAPI HGLRC WINAPI wglGetCurrentContext(VOID);
WINGDIAPI HDC   WINAPI wglGetCurrentDC(VOID);
WINGDIAPI PROC  WINAPI wglGetProcAddress(LPCSTR lpszProc);
WINGDIAPI BOOL  WINAPI wglMakeCurrent(HDC dc, HGLRC rc);
WINGDIAPI BOOL  WINAPI wglShareLists(HGLRC hglrc1, HGLRC hglrc2);
WINGDIAPI BOOL  WINAPI wglUseFontBitmapsA(HDC hdc, DWORD first, DWORD count, DWORD listBase);
WINGDIAPI BOOL  WINAPI wglUseFontBitmapsW(HDC hdc, DWORD first, DWORD count, DWORD listBase);

WINGDIAPI BOOL  WINAPI wglSwapBuffers (HDC dc);
WINGDIAPI int   WINAPI wglChoosePixelFormat (HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd);
WINGDIAPI int   WINAPI wglDescribePixelFormat (HDC hdc, int pf, UINT size, LPPIXELFORMATDESCRIPTOR ppfd);
WINGDIAPI BOOL  WINAPI wglSetPixelFormat (HDC hdc, int pf, CONST PIXELFORMATDESCRIPTOR *pfd);
WINGDIAPI int   WINAPI wglGetPixelFormat (HDC hdc);


typedef struct _POINTFLOAT {
    FLOAT   x;
    FLOAT   y;
} POINTFLOAT, *PPOINTFLOAT;

typedef struct _GLYPHMETRICSFLOAT {
    FLOAT       gmfBlackBoxX;
    FLOAT       gmfBlackBoxY;
    POINTFLOAT  gmfptGlyphOrigin;
    FLOAT       gmfCellIncX;
    FLOAT       gmfCellIncY;
} GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, FAR *LPGLYPHMETRICSFLOAT;

#define WGL_FONT_LINES      0x0
#define WGL_FONT_POLYGONS   0x1
WINGDIAPI BOOL  WINAPI wglUseFontOutlinesA(HDC hdc, DWORD first, DWORD count, DWORD listBase, FLOAT deviation,
                                           FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);
WINGDIAPI BOOL  WINAPI wglUseFontOutlinesW(HDC hdc, DWORD first, DWORD count, DWORD listBase, FLOAT deviation,
                                           FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);

/* Layer plane descriptor */
typedef struct tagLAYERPLANEDESCRIPTOR { // lpd
    WORD  nSize;
    WORD  nVersion;
    DWORD dwFlags;
    BYTE  iPixelType;
    BYTE  cColorBits;
    BYTE  cRedBits;
    BYTE  cRedShift;
    BYTE  cGreenBits;
    BYTE  cGreenShift;
    BYTE  cBlueBits;
    BYTE  cBlueShift;
    BYTE  cAlphaBits;
    BYTE  cAlphaShift;
    BYTE  cAccumBits;
    BYTE  cAccumRedBits;
    BYTE  cAccumGreenBits;
    BYTE  cAccumBlueBits;
    BYTE  cAccumAlphaBits;
    BYTE  cDepthBits;
    BYTE  cStencilBits;
    BYTE  cAuxBuffers;
    BYTE  iLayerPlane;
    BYTE  bReserved;
    COLORREF crTransparent;
} LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, FAR *LPLAYERPLANEDESCRIPTOR;

/* LAYERPLANEDESCRIPTOR flags */
#define LPD_DOUBLEBUFFER        0x00000001
#define LPD_STEREO              0x00000002
#define LPD_SUPPORT_GDI         0x00000010
#define LPD_SUPPORT_OPENGL      0x00000020
#define LPD_SHARE_DEPTH         0x00000040
#define LPD_SHARE_STENCIL       0x00000080
#define LPD_SHARE_ACCUM         0x00000100
#define LPD_SWAP_EXCHANGE       0x00000200
#define LPD_SWAP_COPY           0x00000400
#define LPD_TRANSPARENT         0x00001000

#define LPD_TYPE_RGBA        0x0
#define LPD_TYPE_COLORINDEX  0x1

/* wglSwapLayerBuffers flags */
#define WGL_SWAP_MAIN_PLANE     0x00000001
#define WGL_SWAP_OVERLAY1       0x00000002
#define WGL_SWAP_OVERLAY2       0x00000004
#define WGL_SWAP_OVERLAY3       0x00000008
#define WGL_SWAP_OVERLAY4       0x00000010
#define WGL_SWAP_OVERLAY5       0x00000020
#define WGL_SWAP_OVERLAY6       0x00000040
#define WGL_SWAP_OVERLAY7       0x00000080
#define WGL_SWAP_OVERLAY8       0x00000100
#define WGL_SWAP_OVERLAY9       0x00000200
#define WGL_SWAP_OVERLAY10      0x00000400
#define WGL_SWAP_OVERLAY11      0x00000800
#define WGL_SWAP_OVERLAY12      0x00001000
#define WGL_SWAP_OVERLAY13      0x00002000
#define WGL_SWAP_OVERLAY14      0x00004000
#define WGL_SWAP_OVERLAY15      0x00008000
#define WGL_SWAP_UNDERLAY1      0x00010000
#define WGL_SWAP_UNDERLAY2      0x00020000
#define WGL_SWAP_UNDERLAY3      0x00040000
#define WGL_SWAP_UNDERLAY4      0x00080000
#define WGL_SWAP_UNDERLAY5      0x00100000
#define WGL_SWAP_UNDERLAY6      0x00200000
#define WGL_SWAP_UNDERLAY7      0x00400000
#define WGL_SWAP_UNDERLAY8      0x00800000
#define WGL_SWAP_UNDERLAY9      0x01000000
#define WGL_SWAP_UNDERLAY10     0x02000000
#define WGL_SWAP_UNDERLAY11     0x04000000
#define WGL_SWAP_UNDERLAY12     0x08000000
#define WGL_SWAP_UNDERLAY13     0x10000000
#define WGL_SWAP_UNDERLAY14     0x20000000
#define WGL_SWAP_UNDERLAY15     0x40000000

WINGDIAPI BOOL  WINAPI wglDescribeLayerPlane(HDC _0, int _1, int _2, UINT _3,
                                             LPLAYERPLANEDESCRIPTOR _4);
WINGDIAPI int   WINAPI wglSetLayerPaletteEntries(HDC _0, int _1, int _2, int _3,
                                                 CONST COLORREF *_4);
WINGDIAPI int   WINAPI wglGetLayerPaletteEntries(HDC _0, int _1, int _2, int _3,
                                                 COLORREF *_4);
WINGDIAPI BOOL  WINAPI wglRealizeLayerPalette(HDC _0, int _1, BOOL _2);
WINGDIAPI BOOL  WINAPI wglSwapLayerBuffers(HDC _0, UINT _1);

typedef struct _WGLSWAP
{
    HDC hdc;
    UINT uiFlags;
} WGLSWAP, *PWGLSWAP, FAR *LPWGLSWAP;

#define WGL_SWAPMULTIPLE_MAX 0x10

WINGDIAPI DWORD WINAPI wglSwapMultipleBuffers(UINT _0, CONST WGLSWAP *_1);

